#include <iostream>
using namespace std;
int main()
{
	int n, temp, i, pre = 0, sum = 0;
	cin >> n;
	for(i = 0; i < n; i++){
		cin >> temp;
		int dis = temp - pre;
		sum += dis > 0? dis * 6: -dis * 4;
		sum += 5;
		pre = temp;
	}
	cout << sum;
	return 0;
}
